package com.huaju.enity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * Recoverrecord entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "recoverrecord", catalog = "licai")
public class Recoverrecord implements java.io.Serializable {

	// Fields

	private Integer recordId;
	private Backuprecord backuprecord;
	private Date recoverDate;

	// Constructors

	/** default constructor */
	public Recoverrecord() {
	}

	/** full constructor */
	public Recoverrecord(Backuprecord backuprecord, Date recoverDate) {
		this.backuprecord = backuprecord;
		this.recoverDate = recoverDate;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "record_id", unique = true, nullable = false)
	public Integer getRecordId() {
		return this.recordId;
	}

	public void setRecordId(Integer recordId) {
		this.recordId = recordId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "re_id")
	public Backuprecord getBackuprecord() {
		return this.backuprecord;
	}

	public void setBackuprecord(Backuprecord backuprecord) {
		this.backuprecord = backuprecord;
	}

	@Column(name = "recover_date", length = 19)
    @DateTimeFormat(pattern="yyyy-MM-dd" ) 
    @JsonFormat(pattern="yyyy-MM-dd" ,timezone = "GMT+8")
	public Date getRecoverDate() {
		return this.recoverDate;
	}

	public void setRecoverDate(Date recoverDate) {
		this.recoverDate = recoverDate;
	}

}